using System;
using System.Collections.Generic;
using System.Text;
using MoEngine;
using MoGameLib;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace MoGameLib
{
    public class SiteListItem : Window
    {
        public SiteListItem(WindowBase parent, Site site)
            : base(parent)
        {
            m_viewSite = site;
            m_IconFrame = Core.Content.Load<Texture2D>("Images/GUI/SiteIconFrame");
            m_Font = Core.Content.Load<SpriteFont>("Fonts/Arial");

        }

        protected Site m_viewSite;

        protected Texture2D m_IconFrame;
        protected SpriteFont m_Font;

        protected override void DrawWindow(GameTime time)
        {
            base.DrawWindow(time);
            m_SpriteBatch.Begin();
            Texture2D icon = m_viewSite.Icon;
            Vector2 iconCen = new Vector2(DrawRect.X + 5 + icon.Width / 2, DrawRect.Y + DrawRect.Height / 2);
            m_SpriteBatch.Draw(icon, iconCen - new Vector2(icon.Width / 2, icon.Height / 2), Color.White);
            m_SpriteBatch.Draw(m_IconFrame, iconCen - new Vector2(m_IconFrame.Width / 2, m_IconFrame.Height / 2), Color.White);

            int nameX = 50;
            int nameY = 10;
            m_SpriteBatch.DrawString(m_Font, m_viewSite.GameName, DrawPos + new Vector2(nameX + 1, nameY + 1), Color.Black);
            m_SpriteBatch.DrawString(m_Font, m_viewSite.GameName, DrawPos + new Vector2(nameX, nameY), Color.LightYellow);

            m_SpriteBatch.End();
        }
    }
}
